#include "../src/stackapp/stackapp.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

extern func_StackApp fun_StackApp;

int main(int argc, const char *argv[])
{
    const char *exp = "8+(3-1)*5";
    char abcd1[20] = {0};
    fun_StackApp.transform(exp, abcd1);
    printf("\tabcd1 = %s\n\n", abcd1);

    const char *exp1 = "8+4-6*2";
    char abcd2[20] = {0};
    fun_StackApp.transform(exp1, abcd2);
    printf("\tabcd2 = %s\n\n", abcd2);

    const char *exp2 = "1+2*3";
    char abcd3[20] = {0};
    fun_StackApp.transform(exp2, abcd3);
    printf("\tabcd3 = %s\n\n", abcd3);

    int ret = 0, out = 0;
    ret = fun_StackApp.computer(abcd1, &out);
    printf("ret = %d, out =  %d\n", ret, out);

    ret = fun_StackApp.computer(abcd2, &out);
    printf("ret = %d, out =  %d\n", ret, out);

    ret = fun_StackApp.computer(abcd3, &out);
    printf("ret = %d, out =  %d\n\n", ret, out);

    return 0;
}
